﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTServices.Entities;
using Caliburn.Micro;
using GTServices.Model;
using System.Windows;
using System.Windows.Data;
using GTServices.WPF.Client.ViewModels;
using System.Reflection;
using GTServices.WPF.Client.Extensions;
using GTServices.Model.Extensions;
using System.Windows.Controls;
using GTServices.WPF.Client.Interfaces;


namespace GTServices.WPF.Client.ViewModels.Entities
{
    public class MatchInfoViewModel : Screen, IEntityViewModel
    {
      
        private MatchInfo _matchInfo; 
        public MatchInfo MatchInfo { 

            get{
                return _matchInfo;
            } 
            
            set{
                _matchInfo = value;
                //I switch the SelectedMatchInfo to the MatchInfo on when the Match info changes. 
                NotifyOfPropertyChange(() => MatchInfo);
            } 
        }

        public Object Model
        {
            get { return this.MatchInfo; }
            set
            {
                if (value is MatchInfo)
                    MatchInfo = value as MatchInfo;
            }
        }

    
        public bool Reviewed
        {
            get { return MatchInfo.Reviewed; }
            set { MatchInfo.Reviewed = value; NotifyOfPropertyChange(() => Reviewed); }
        }

      


        public String SelectedText { get; set; }
        public String SelectedLanguage { get; set; }

        /// <summary>
        /// I dont take the MatchInfo as a param because the UI will fail to refresh and "goto" the appropriate line as a result. 
        /// </summary>
        /// <param name="parentVM"></param>
        public MatchInfoViewModel(){

            this.SelectedText = "";
            this.SelectedLanguage = "";
        }


    }
}
